
//创建子窗口
function onClick_OpenWindow(){
    win = window.open('./child.html','子窗口','width=300,height=200');
    // win = window.open('https://www.baidu.com/')
}
//获取焦点
function onClick_Focus() {
    if(win != undefined) {
        win.focus();
    }
}
//失去焦点
function onClick_Blur() {
    if(win != undefined) {
        win.blur();
    }
}
//关闭窗口

function onClick_Close() {
    if(win != undefined) {
        if(win.closed) {
            alert('子窗口已关闭，不需要再关闭');
            return;
        }
        win.close();
    }
}
//显示打印对话框
function onClick_PrintDialog() {
    if(win != undefined) {
        win.print();
    }
}
